local sk__duoji = fk.CreateSkill {

  name = "sk__duoji",

  tags = { Skill.Compulsory, },

}



sk__duoji:addEffect(fk.Death, {
  name = "sk__duoji",
  anim_type = "drawcard",
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(sk__duoji.name) and data.damage and data.damage.from == player
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    if not target:isKongcheng() then
      room:moveCardTo(target:getCardIds("h"), Card.PlayerHand, player, fk.ReasonPrey, sk__duoji.name, nil, false, player)
    end
    if player.dead then return end
    local skills = table.filter(target:getSkillNameList(), function(s)
      return Fk.skills[s]:isPlayerSkill(target) and Fk.skills[s].visible and not player:hasSkill(s, true)
    end)
    if #skills > 0 then
      room:handleAddLoseSkills(player, skills, nil, true, false)
    end
  end,
})

return sk__duoji
